﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Commercial;

public partial class UserControl_BrandManager : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Brand brand = new Brand();

            grvBrandManager.DataSource = brand.ListBrand();
            grvBrandManager.DataBind();
        }
    }
    protected void grvBrandManager_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Literal status = (Literal)e.Row.FindControl("Literal_Status");
            if (status.Text == "0")
            {
                status.Text = "DN thường";
            }
            else
            {
                status.Text = "DN VIP";
            }

            Literal check = (Literal)e.Row.FindControl("Literal_Check");
            if (check.Text == "0")
            {
                check.Text = "Chờ duyệt";
            }
            else
            {
                check.Text = "Được duyệt";
            }
        }
    }
    protected void grvBrandManager_RowCommand(object source, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "deleteOutbox")
        {
            try
            {

            }
            catch (Exception)
            {
            }
        }
    }

    protected void grvBrandManager_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.grvBrandManager.PageIndex = e.NewPageIndex;
        HttpCookie _user = Request.Cookies["userinfo"];
        if (Request.Cookies["userinfo"] != null)
        {
            if (_user["username"] != null)
            {
                
            }
        }
    }
}